Skip to content

Conversation

@rohangirishrao
Copy link
Contributor

Safe way of parsing Fiji script params by ignoring the passwords field automatically.

Calls on scijava.script.ScriptModule through Python globals to access only the user-given parameters and not other variables at run-time.
The method now ignores password in a clean way, and skips some other
non-essential runtime keys.
@codecov
Copy link

codecov bot commented Nov 5, 2025

Codecov Report

❌ Patch coverage is 4.54545% with 21 lines in your changes missing coverage. Please review.
✅ Project coverage is 25%. Comparing base (26f64c9) to head (cd9795f).

Files with missing lines Patch % Lines
src/imcflibs/imagej/misc.py 5% 21 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff          @@
##           master   #111   +/-   ##
=====================================
- Coverage      25%    25%   -0%     
=====================================
  Files          25     25           
  Lines        1688   1710   +22     
=====================================
+ Hits          421    422    +1     
- Misses       1267   1288   +21     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@rohangirishrao rohangirishrao changed the title Add method to save FIji script parameters, and add example to opening an image Add method to save Fiji script parameters, and add example to opening an image Nov 7, 2025
Comment on lines 749 to 752
# Skip if parameter is declared with style="password"
style = item.getWidgetStyle()
if style is not None and style.lower() == "password":
continue
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could use WidgetStyle.isStyle(ModuleItem<?> item, String target) here:

Suggested change
# Skip if parameter is declared with style="password"
style = item.getWidgetStyle()
if style is not None and style.lower() == "password":
continue
# Skip if parameter is declared with style="password"
if WidgetStyle.isStyle(item, TextWidget.PASSWORD_STYLE):
continue

Note also the use of public constants instead of hard-coded strings here 😉

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For future PR's, please try to not have completely unrelated stuff in one PR as this is more difficult to review (sure, not in the case of a docstring change, but still) and will potentially block stuff from being merged.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy that!

@ehrenfeu ehrenfeu added this to the 2.0.0 milestone Jan 14, 2026
@ehrenfeu ehrenfeu added enhancement New feature or request new-minor Change introduced in PR will require a new minor release. labels Jan 14, 2026
@ehrenfeu ehrenfeu moved this to In progress in imcflibs Jan 14, 2026
@rohangirishrao rohangirishrao changed the base branch from master to devel January 14, 2026 13:29
@ehrenfeu ehrenfeu added the changelog Needs to be mentioned in release changelogs label Jan 14, 2026
@ehrenfeu
Copy link
Member

Add to changelog #126

@imagejan
Copy link

From the GitHub Actions checks:

src/imcflibs/imagej/misc.py:19: in <module>
    from org.scijava.widget import WidgetStyle
E   ModuleNotFoundError: No module named 'org'

Looks like you need to update imcf-fiji-mocks now (and bump its version here) to provide the necessary org.scijava classes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog Needs to be mentioned in release changelogs enhancement New feature or request new-minor Change introduced in PR will require a new minor release.

Projects

Status: In progress

Development

Successfully merging this pull request may close these issues.

3 participants